<?php

defined('SYSPATH') or die('Access error!');

/**
 * 用户中心的处理任务的类
 * ============================================================================
 * 功能描述： 
 *     用来处理用户的任务处理
 * ============================================================================
 * $Author: liuxudong $
 */
class Controller_User_Trade_Supply extends Controller_User_Trade_Post
{

    public function before()
    {
        parent::before();
        $this->where_arr['post_type'] = 'supply';
        $this->template->assign('current_selected', URL::site('user/trade/supply'));
    }

    public function action_index()
    {
        $this->display_list();
    }

    public function action_over()
    {
        $this->where_arr['limit_time<'] = Date::get_time();
        $this->display_list();
    }

    public function action_unover()
    {
        $this->where_arr['limit_time>'] = Date::get_time();
        $this->display_list();
    }

    public function display_list()
    {

        $trade_post_menu = array(
            array(
                'name' => '全部',
                'url' => URL::site('user/trade/supply'),
            ),
            array(
                'name' => '未结束',
                'url' => URL::site('user/trade/supply/unover'),
            ),
            array(
                'name' => '已结束',
                'url' => URL::site('user/trade/supply/over'),
            ),
        );
        $this->template->assign('trade_post_menu', $trade_post_menu);
        parent::display_list();
    }

}